import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.geom.Ellipse2D;
import java.util.List;

import javax.swing.JComponent;


public class ParticlesComponent extends JComponent
{
	private List<MyObject> objects;
	private List<Wall> walls;
	private World world;
	public ParticlesComponent(World world)
	{
		super();
		this.world = world;
		this.objects = world.getObjects();
		this.walls = world.walls;
	}
	@Override
	public void paintComponent(Graphics g)
	{
		Graphics2D g2 = (Graphics2D) g;
		g2.setColor(Color.RED);
		g2.setStroke(new BasicStroke(1.3F));
		g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		for(int i = 0; i < objects.size(); i++)
			objects.get(i).paintObject(g2);
		for(int i = 0; i < walls.size(); i++)
			walls.get(i).paintObject(g2);
	}
}
